import hmac
import hashlib

def hmac_encode(plaintext, salt):
    key = salt.encode()
    message = plaintext.encode()
    h = hmac.new(key, message, hashlib.sha256).hexdigest()
    # 截取前22个字符（需验证是否符合规则）
    return h[:22]

# 示例：假设盐值为固定字符串
salt = "your_secret_salt"
print(hmac_encode("558770", salt))  # 需验证是否匹配c0Gkng2912yj1vRRtcho
print(hmac_encode("885864", salt))  # 需验证是否匹配xy0367tAEAZEdHdf0kHj